<!--
 * @Author: 尔尔
 * @Date: 2023-12-26 14:40:15
 * @LastEditors: 尔尔
 * @LastEditTime: 2025-02-17 14:24:25
 * @FilePath: \ERP\src\App.vue
 * @filePurpose:
-->
<template>
	<div id="app">
		<router-view v-if="isShow" />
		<!-- <theme-picker /> -->
	</div>
</template>

<script>
// import ThemePicker from "@/components/ThemePicker";

export default {
	name: "App",
	// components: { ThemePicker },
	provide() {
		return {
			reload: this.reload
		}
	},
	data() {
		return {
			isShow: true
		}
	},
  mounted(){
    window.addEventListener('beforeunload',this.beforeunloads)

  },
  destroyed(){
    window.addEventListener('beforeunload',this.beforeunloads)
  },
	methods: {
    beforeunloads(){
          // localStorage.removeItem("tableData")
          // localStorage.removeItem("tableDatas")
    },
		reload() {
			this.isShow = false
			this.$nextTick(() => {
				this.isShow = true
			})
		}
	},
	metaInfo() {
		return {
			title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
			titleTemplate: title => {
				return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
			}
		}
	}
}
</script>
<style scoped>
/* #app .theme-picker {
  display: none;
}*/
</style>
